<!-- INCLUDE sv_overall_header.html -->
 <div id="fb-root"></div>
 <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId   : '{S_FB_APP_ID}',
          session : {S_FB_SESSION}, // don't refetch the session when PHP already has it
          status  : true, // check login status
          cookie  : true, // enable cookies to allow the server to access the session
          xfbml   : true // parse XFBML
        });

        // whenever the user logs in, we refresh the page
        FB.Event.subscribe('auth.login', function() {
          //window.location.reload();
        });
      };
      
      (function() {
        var e = document.createElement('script');
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
      }());     

      function fb_invite()
      {
	      FB.ui({method: 'apprequests', message: '{L_SV_INVITE_FRIENDS_MESSAGE}', data: ''});
      };
</script>

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
	<!-- IF IN_FB_IFRAME -->
		
		<BR>
		<BR>
	<!-- ELSE -->
	<form method="post" action="{S_LOGIN_ACTION}" class="headerspace">
	<h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- IF S_REGISTER_ENABLED -->&nbsp; &bull; &nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a><!-- ENDIF --></h3>
		<fieldset class="quick-login">
			<label for="username">{L_USERNAME}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" />
			<label for="password">{L_PASSWORD}:</label>&nbsp;<input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" />
			<!-- IF S_AUTOLOGIN_ENABLED -->
				| <label for="autologin">{L_LOG_ME_IN} <input type="checkbox" name="autologin" id="autologin" /></label>
			<!-- ENDIF -->
			<input type="submit" name="login" value="{L_LOGIN}" class="button2" />
			{S_LOGIN_REDIRECT}
		</fieldset>
	</form>
	<!-- ENDIF -->
<!-- ENDIF -->
<h2> <a href='#' onclick="fb_invite();return false;">{L_SV_INVITE_FRIENDS}</a> </h2>

<!-- IF SHOW_USER_VALUE -->
<div class="panel" style="float:left;margin-right:1em;"> 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{L_SV_MARKET_VALUE_RANKING} ( {L_SV_RANKING_DATE}: {RANKING_DATE} )</h2> 
	
	</div>
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>
			<td><p>{L_SV_RANK_INDEX}</p></td>
			<td></td>
			<td><p>{L_SV_USER_NAME}</p></td>
			<td><p>{L_SV_MARKET_VALUE}</p></td>
			
		</tr>
		<!-- BEGIN list -->
		<tr>	
			<td><p>{list.INDEX}</p></td>		
			<td><img src="http://graph.facebook.com/{list.USER_FB_ID}/picture" width=32 height=32></td>
			<td><p><a href="{S_QUERY_USER}&user_id={list.USER_ID}">{list.USER_NAME}</a></p>
			</td>
			<td><p>{list.VALUE}</p></td>
			
		</tr>
		<!-- END list -->
	</table>
</div>
<!-- ELSE -->
<h2>{L_SV_NO_DATA_IN_FB_FRIENDS_RANKING}</h2>
<!-- ENDIF -->

<!-- IF SHOW_1_MONTH_ROI -->
<div class="panel" style="float:left;margin-right:1em;"> 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{L_SV_ROI_RANKING_LAST_1_MONTH}</h2> 
	
	</div>
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>
			<td><p>{L_SV_RANK_INDEX}</p></td>
			<td></td>
			<td><p>{L_SV_USER_NAME}</p></td>
			<td><p>{L_SV_ROI}</p></td>
			
		</tr>
		<!-- BEGIN roi_1_month_list -->
		<tr>	
			<td><p>{roi_1_month_list.INDEX}</p></td>		
			<td><img src="http://graph.facebook.com/{roi_1_month_list.USER_FB_ID}/picture" width=32 height=32></td>
			<td><p><a href="{S_QUERY_USER}&user_id={roi_1_month_list.USER_ID}">{roi_1_month_list.USER_NAME}</a></p></td>
			<td><p>{roi_1_month_list.ROI}%</p></td>			
		</tr>
		<!-- END list -->
	</table>
</div>
<!-- ENDIF -->

<!-- IF SHOW_3_MONTH_ROI -->
<div class="panel" style="float:left;margin-right:1em;"> 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{L_SV_ROI_RANKING_LAST_3_MONTH}</h2> 
	
	</div>
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>
			<td><p>{L_SV_RANK_INDEX}</p></td>
			<td></td>
			<td><p>{L_SV_USER_NAME}</p></td>
			<td><p>{L_SV_ROI}</p></td>
			
		</tr>
		<!-- BEGIN roi_3_month_list -->
		<tr>	
			<td><p>{roi_3_month_list.INDEX}</p></td>	
			<td><img src="http://graph.facebook.com/{roi_3_month_list.USER_FB_ID}/picture" width=32 height=32></td>	
			<td><p><a href="{S_QUERY_USER}&user_id={roi_3_month_list.USER_ID}">{roi_3_month_list.USER_NAME}</a></p></td>
			<td><p>{roi_3_month_list.ROI}%</p></td>
			
		</tr>
		<!-- END list -->
	</table>
</div>
<!-- ENDIF -->

<!-- IF SHOW_6_MONTH_ROI -->
<div class="panel" > 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{L_SV_ROI_RANKING_LAST_6_MONTH}</h2> 
	
	</div>
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>
			<td><p>{L_SV_RANK_INDEX}</p></td>
			<td></td>
			<td><p>{L_SV_USER_NAME}</p></td>
			<td><p>{L_SV_ROI}</p></td>
			
		</tr>
		<!-- BEGIN roi_6_month_list -->
		<tr>	
			<td><p>{roi_6_month_list.INDEX}</p></td>	
			<td><img src="http://graph.facebook.com/{roi_6_month_list.USER_FB_ID}/picture" width=32 height=32></td>	
			<td><p><a href="{S_QUERY_USER}&user_id={roi_6_month_list.USER_ID}">{roi_6_month_list.USER_NAME}</a></p></td>
			<td><p>{roi_6_month_list.ROI}%</p></td>
			
		</tr>
		<!-- END list -->
	</table>
</div>
<!-- ENDIF -->

<!-- IF SHOW_12_MONTH_ROI -->
<div class="panel" > 
	<div class="inner"><span class="corners-top"><span></span></span> 
	<h2>{L_SV_ROI_RANKING_LAST_12_MONTH}</h2> 
	
	</div>
	<table border="0" cellpadding="5" cellspacing="5">
		<tr>
			<td><p>{L_SV_RANK_INDEX}</p></td>
			<td></td>
			<td><p>{L_SV_USER_NAME}</p></td>
			<td><p>{L_SV_ROI}</p></td>
			
		</tr>
		<!-- BEGIN roi_12_month_list -->
		<tr>	
			<td><p>{roi_12_month_list.INDEX}</p></td>	
			<td><img src="http://graph.facebook.com/{roi_12_month_list.USER_FB_ID}/picture" width=32 height=32></td>	
			<td><p><a href="{S_QUERY_USER}&user_id={roi_12_month_list.USER_ID}">{roi_12_month_list.USER_NAME}</a></p></td>
			<td><p>{roi_12_month_list.ROI}%</p></td>
			
		</tr>
		<!-- END list -->
	</table>
</div>
<!-- ENDIF -->


<!-- INCLUDE sv_overall_footer.html -->